#=
可视化
=#


push!(LOAD_PATH, "/Users/mary/workspace/")
using pimary
using Plots



"""
绘制世界线
"""
function draw_fb3D!(plt::Plots.Plot, fb::WrdFb, color::Symbol; hidend=false)
    Nt = size(fb[1])[1]
    sl = hidend ? (1:Nt-1) : (1:Nt)
    for ip in Base.OneTo(length(fb))
        scatter3d!(plt, fb[ip][sl, 1], fb[ip][sl, 2], fb[ip][sl, 3], color=color, markersize=4, label="")
        plot3d!(plt, fb[ip][sl, 1], fb[ip][sl, 2], fb[ip][sl, 3], color=color, label="")
        if !hidend
            plot3d!(plt, fb[ip][[1, Nt], 1], fb[ip][[1, Nt], 2], fb[ip][[1, Nt], 3],
            linestyle=:dot, color=color, label="")
        end
    end
end


#"""
#运行
#"""
#function run()
#    Np = 1
#    Nt = 10
#    vol = 2.0
#    fbup = random_path(Float64, Np, Nt, vol)
#    fbdn = random_path(Float64, Np, Nt, vol)
#    fbne = random_point(Float64, Np, Nt, vol)
#    plt = plot()
#    println(fbup)
#    draw_fb3D!(plt, fbup, :red)
#    draw_fb3D!(plt, fbdn, :green)
#    draw_fb3D!(plt, fbne, :blue)
#    #
#    fbup2 = move_at(1, 2, fbup, vol)
#    draw_fb3D!(plt, fbup2, :pink)
#    savefig(plt, "test.png")
#end
#
#run()
